class I19_TC1
{
public:
	int value=100;
};

void tc1_defaultGeneration()
{
	I19_TC1 tc1_0;		//default ctor is generated if no any ctor defined.
	I19_TC1 tc1_1(tc1_0);	//copy ctor is generated if no user-declared copy ctor nor any move operation.
	tc1_0 = tc1_1;		//copy assignment operator is generated if no user-declared assignment nor move operation.
	I19_TC1 tc1_2 = I19_TC1();	//move ctor? or copy ctor.

	tc1_0.~I19_TC1();	//dctor is also generated. 

	//try to figure out how to check if move ctor is generated. 

}

class I19_TC2_1
{
public:
	I19_TC2_1(int) {}
};

class I19_TC2_2
{
public:
	I19_TC2_2() {}
	I19_TC2_2(I19_TC2_2&& rhs){}
};

class I19_TC2_3
{
public:
	~I19_TC2_3() {}
	I19_TC2_3() {}	
};

void tc2_suppressGeneration()
{
	//I19_TC2_1 tc2_0;  //error, no default ctor available.
	I19_TC2_1 tc2_1(0);
	I19_TC2_1 tc2_2(tc2_1);	//still have copy ctor
	tc2_1 = tc2_2;			//still have copy assignment operator

	//I19_TC2_2 tc2_3;	//no default ctor available, because of move ctor, so has to defind one. 
	I19_TC2_2 tc2_4;	//use user-declared ctor
#ifndef __GNUC__
	I19_TC2_2 tc2_5(tc2_4);	//VS 2013 does not complian this, but the c++ std is not allowing this.
							//The move ctor has been declared, copy ctor is deleted (by compiler).
	tc2_4 = I19_TC2_2();	//gcc492 fails to compile because the copy assignment is deleted, but not move assignment.
#endif	

	I19_TC2_3 tc2_6;
	I19_TC2_3 tc2_7= I19_TC2_3(); //Can't prove, the move ctor should not be generated since user dtor is there, 
}

class I19_TC3_1
{
public:
	I19_TC3_1() {}
	~I19_TC3_1() {}
#ifdef __GNUC__
	I19_TC3_1(const I19_TC3_1&) = delete;	//no copy ctor
	I19_TC3_1(I19_TC3_1&&) = default;		//make sure move ctor is generated, VS2013 does not like this.
#endif
};

void tc3_makesureGeneration()
{
	I19_TC3_1 tc1 = I19_TC3_1();		//it is calling move ctor (VS2013 may call copy ctor)
}


int Test_I19_SpecialMemberFunctionGeneration(int, char**)
{
	tc1_defaultGeneration();
	tc2_suppressGeneration();
	tc3_makesureGeneration();
	return 0;
}

/*
Things to Remember
- The special member functions are those compilers may generate on their own:
  the default constructor, destructor, copy operations, and move operations.
- Move operations are generated only for classes lacking explicitly-declared
  move operations, copy operations, and a destructor.
- The copy constructor is generated only for classes lacking an explicitly
  declared copy constructor and the move operations. The copy assignment 
  operator is generated only for classes lacking an explicitly-declared copy 
  assignment operator and the move operations. Generation of the copy operations in
  classes with an explicitly-declared destructor is deprecated,
- Member function templates never suppress generation of special member
  functions.
*/